package org.omg.dds.rpc;

import org.omg.dds.domain.DomainParticipant;
import org.omg.dds.sub.DataReaderQos;
import org.omg.dds.pub.DataWriterQos;
import org.omg.dds.core.Duration;
import java.lang.String;

public abstract class Service <TReq, TRep> {
	
  // Creates a Service with the minimum set of parameters. 
  public Service (DomainParticipant participant, 
                  String service_name,
                  String instance_name)
  {}
           
  // Creates a Service with parameters. 
  public Service(ServiceParams params)
  {}
  
  // blocking take
  abstract public void receive(TReq request, RequestIdentity identity, Duration duration);
  
  // blocking take with sampleinfo
  abstract public void receive(Sample<TReq> request, RequestIdentity identity, Duration duration);
  
  // blocking take
  // SampleInfo will contain the request identity.
  abstract public LoanedSamples<TReq> receive(Duration duration);
  
  abstract public boolean wait(Duration duration);
  
  // non-blocking take
  abstract public boolean takeRequest(TReq request, RequestIdentity identity);
  
  // non-blocking take with sampleinfo
  abstract public boolean takeRequest(Sample<TReq> sample, RequestIdentity identity);
  
  // read-blocking take
  abstract public boolean readRequest(TReq request, RequestIdentity identity);
  
  // non-blocking take with sampleinfo
  abstract public boolean readRequest(Sample<TReq> sample, RequestIdentity identity);
  
  abstract public boolean reply(TRep reply, RequestIdentity identity);
  
  abstract public void setReplyDataWriterQos(DataWriterQos dwqos);

  abstract public void setRequestDataReaderQos(DataReaderQos drqos);
};

